import { axios } from '@/utils/request'

// 获取系统配置
export const getSystemSettings = () => {
  return new Promise((resolve) => {
    resolve({
      message: "success",
      status: 200,
      data: {
        name: '数据标注系统',
        logo: '',
        profile: '',
        copyright: ''
      }
    })
  })
  // return axios({
  //   url: '/system-settings',
  //   method: 'get'
  // })
}

// 图片上传
export const imageUpload = (data, onUploadProgressCallBack) => {
  return axios.request({
    url: '/image-upload',
    method: 'post',
    data,
    onUploadProgress: (progressEvent) => { 
      if (onUploadProgressCallBack) { 
        onUploadProgressCallBack(progressEvent) 
      }
    }
  })
}

export const getAreaTree = () => {
  return axios.request({
    url: '/area-tree',
    method: 'get'
  })
}

export const imageUploadUrl = process.env.VUE_APP_API_BASE_URL + '/image-upload'